package com.example.blog.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class Response {
    //0成功 2异常 3 权限 4失败
    public static final Integer SUCCEED_CODE = 200; //成功
    public static final Integer ERROR_CODE = 404;  // 失败
    public static final Integer ERROR_Permissions = 403;  //权限不足/IP访问禁止
    public static final Integer ERROR_EXCEPTION = 502; //异常
    public static final Integer SYSTEM_ERROR_EXCEPTION = 500; //系统未知异常
    public static final Integer ERROR_TOKEN = 604; //token失败
    public static final Integer Remote = 408; //用户已在别处登录
    public static final Integer ERROR_EXISTS = 407; //用户已在别处登录
    public static final Integer ERROR_PARAMETER = 400; //参数校验失败
    private Integer code;
    private String msg;
    private Object data;
    public Response(Integer code, Object data) {
        this.code = code;
        this.data = data;
    }
    public Response(Integer code, String msg, boolean message) {
        this.code = code;
        this.msg = msg;
    }

}
